﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Ex03.VehicalsObjectModel
{
    public class ValueOutOfRangeException : Exception
    {
        private float m_MinValue;
        private float m_MaxValue;

        /// <summary>
        /// Creates a new ValueOutOfRangeException Object
        /// </summary>
        /// <param name="i_MinValue">The minumum value allowed</param>
        /// <param name="i_MaxValue">The maximum value allowed</param>
        public ValueOutOfRangeException(float i_MinValue, float i_MaxValue) : base(string.Format("Value must be between {0} and {1}", i_MinValue, i_MaxValue))
        {
            m_MaxValue = i_MaxValue;
            m_MinValue = i_MinValue;
        }

        /// <summary>
        /// Gets the maximum value allowed
        /// </summary>
        public float MaxValue
        {
            get 
            { 
                return m_MaxValue; 
            }
        }

        /// <summary>
        /// Gets the minumum value allowed
        /// </summary>
        public float MinValue
        {
            get 
            { 
                return m_MinValue; 
            }
        }
    }
}
